<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
	</head>

	<body>
		<h1>详见console.log输出</h1>
		
		<script type="text/javascript">
			window.onload = function(){
				var x = "testing: 1,2,3";
				var pattern = /\d+/g;
				var a = pattern.test(x);
				var b = x.search(pattern);
				var c = x.match(pattern);
				var d = x.replace(pattern,"#");
				var e = x.split(/\D+/);
				console.log(a);//true
				console.log(b);//9
				console.log(c);//["1","2","3"]
				console.log(d);//testing: #,#,#
				console.log(e);//["","1","2","3"] 有一个空的是因为1前面全部是非数字(相当于字符串",1,2,3"用逗号分隔)
				console.log("x"?true:false);//true
				console.log(NaN?true:false);//false		
				console.log(undefined?true:false);//false				
				console.log(0?true:false);//false
				console.log((-0)?true:false);//false			
				console.log(""?true:false);//false	
				console.log(null?true:false);//false
				console.log(1?true:false);//true
				console.log(null==undefined?true:false);//true
				console.log(null===undefined?true:false);//false ===表示恒等运算(不对操作符进行类型转换)
				//undefined可以理解为是系统级的、意料之外的或类似错误的值的空缺
				//null是程序级的、正常的或在意料之中的值的空缺
				//如果要作为参数传入函数,null是最佳选择 
				console.log(typeof(null));//object
				console.log(typeof(undefined));//undefined
				//null是object,说明它是一个对象,只有一个对象实例-null..
				//undefined是一个undefined类型的变量其值就是undefined,只读
				//null, undefined都是没有属性的
				
			};
		
		</script>
	</body>

</html>